<div class="span12">
    <div class="box box-color box-bordered">
        <div class="box-title">
            <h3>
                <i class="icon-table"></i>
                Usuarios
            </h3>
            <div class="actions">
                <?php if (myCapability::testcap($caps, myCapability::C('CAP_M_ADMIN_CREATE'))) { ?> 
                    <a href="<?php echo url_for('adminusers/addUsers'); ?>" class='btn'>
                        <i class="icon-plus-sign"></i> Agregar Usuario</a>
                <?php } ?>
            </div>
        </div>
        <div class="box-content nopadding">
            <table class="table table-bordered dataTable table-striped table-hover dataTable-colvis">
                <thead>
                    <tr>
                        <th>Nombre</th>
                        <th>Apellido</th>
                        <th>Email</th>
                        <th>Teléfono</th>
                        <th>Creación</th>
                        <th>Acciones</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($users as $value) { ?>

                        <tr>
                            <td><?php echo $value['name']; ?></td>
                            <td><?php echo $value['last_name']; ?></td>
                            <td><?php echo $value['email']; ?></td>
                            <td><?php echo $value['phone_number']; ?></td>
                            <td><?php echo $value['creation_date']; ?></td>
                            <td>
                                <?php if (myCapability::testcap($caps, myCapability::C('CAP_M_ADMIN_UPDATE'))) { ?> 
                                    <a href="<?php echo url_for('adminusers/editUsers'); ?>?id=<?php echo $value['id_users']; ?>"><button class="btn"><i class="icon-edit"></button></i></a>

                                    <a href="#" >
                                        <button class="btn btn-<?php echo ($value['active']) ? 'danger' : 'success'; ?>" onclick="UserActive(<?php echo $value['id_users']; ?>,<?php echo $value['active']; ?>);">
                                            <i class="icon-thumbs-<?php echo ($value['active']) ? 'down' : 'up'; ?>"></i>
                                        </button>
                                    </a>
                                <?php } ?>
                                <?php if (myCapability::testcap($caps, myCapability::C('CAP_M_ADMIN_DELETE'))) { ?>     
                                    <a href="#" >
                                        <button class="btn btn-<?php echo (!$value['deleted']) ? 'danger' : 'success'; ?>" onclick="UserDelete(<?php echo $value['id_users']; ?>,<?php echo $value['deleted']; ?>);">
                                            <i class="icon-remove-<?php echo (!$value['deleted']) ? 'circle' : 'sign'; ?>"></i>
                                        </button>
                                    </a>
                                <?php } ?>

                            </td>
                        </tr>
                    <?php } ?>


                </tbody>
            </table>
        </div>
    </div>
</div>